home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / bbsread / log2info.br < prev    next >
Text File  |  1998-05-24  |  2KB  |  60 lines

  1. /*
  2. $VER: Log2Info 1.0 (13.2.97)
  3. (c)  Neil Bothwick <neil@wirenet.co.uk> 1997
  4. */
  5.  
  6. /* Adds the contents of a temporary logfile      */
  7. /* to the Information conference                 */
  8.  
  9. /* Set ConnectTHOR of Get/SendTCP to log to the file       */
  10. /* specified in InfoLog. If you also want the information  */
  11. /* logged to a permanent file, specify the name in MainLog */
  12.  
  13. MainLog     = 'UUSpool:Connect.log' /* Name of main logfile to copy to, leave blank if you don't want a copy */
  14. InfoLog     = 'UUSpool:Info.log'    /* Temporary logfile to be added to Information conference */
  15. System      = 'Wirenet'             /* The system containing your information conference */
  16. Conf        = 'Information'         /* The name of your information conference */
  17. ShowStartup = 0                     /* Set to 1 to show Startup/Exit messages */
  18.  
  19. /* Don't change anything below here */
  20.  
  21. options results
  22. address command
  23.  
  24. if ~exists(InfoLog) then exit
  25.  
  26. /* Load bbsread.library if necessary */
  27. if ~show('p', 'BBSREAD') then do
  28.     address command
  29.     "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  30.     "WaitForPort BBSREAD"
  31.     end
  32.  
  33. /* Copy temporary log contents to main logfile */
  34. if symbol('MainLog') = 'VAR' & MainLog > '' then 'type' InfoLog '>>'MainLog
  35.  
  36. if ~open(log,InfoLog,'R') then exit
  37. drop MsgData.
  38. MsgData.TEXT.COUNT = 0
  39. body = ''
  40.  
  41. /* Read log file */
  42. do while ~eof(log)
  43.     line = readln(log)
  44.     if ShowStartup = 0 & (word(line,3) = 'STARTUP' | word(line,3) = 'EXIT') then iterate
  45.     MsgData.TEXT.COUNT = MsgData.TEXT.COUNT + 1
  46.     interpret 'MsgData.TEXT.'MsgData.TEXT.COUNT '= line'
  47.     end
  48. call close(log)
  49.  
  50. /* Write message to conference */
  51. address BBSREAD
  52. MsgData.FROMNAME = 'Log2Info'
  53. MsgData.SUBJECT = 'Log information'
  54. 'WRITEBRMESSAGE "'System'" "'Conf'" stem MSGDATA'
  55. if RC > 0 then say BBSREAD.LASTERROR
  56.  
  57. address command
  58. 'delete >NIL:' InfoLog
  59.  
  60.